<?php
  header("Content-Type:text/html;charset=utf-8");
   $db=new mysqli("localhost","root","","db_bbs","3306");
   if ($db->connect_error)
   {
       die("连接失败，原因".$db->connect_error);
   }
  $db->query("set names utf8");
   $sql="select * from t_message order by m_date desc";
   $result=$db->query($sql);
   $sum=$result->num_rows;  
   $bbslist=$result->fetch_all(MYSQLI_BOTH);  
?>